using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace EndNoteHelper
{
    public partial class ListViewTest : Form
    {
        public ListViewTest()
        {
            InitializeComponent();
        }

        private void listView1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop)
                ||e.Data.GetDataPresent(DataFormats.Text))
                e.Effect = DragDropEffects.Link;
            else e.Effect = DragDropEffects.None;
        }

        private void listView1_DragDrop(object sender, DragEventArgs e)
        {
            Array items = e.Data.GetData(DataFormats.FileDrop) as Array;

            if (items != null)
            {
                for (int i = 0; i < items.Length; i++)
                {
                    AppPrompt.SimplePrompt(items.GetValue(i).ToString());
                }
            }
        }

        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control)
            {
                ListViewItem lvi = new ListViewItem(Clipboard.GetData(DataFormats.Text).ToString());
                listView1.Items.Add(lvi);
            }

            base.OnKeyDown(e);
        }
    }
}